<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- qrhimetal.mm -->
  <title>QRhiMetalInitParams Struct | Qt GUI 5.14.2</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="../qtdoc/index.html">Qt 5.14</a></td><td ><a href="qtgui-index.html">Qt GUI</a></td><td ><a href="qtgui-module.html">C++ Classes</a></td><td >QRhiMetalInitParams</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="qtgui-index.html">Qt 5.14.2 Reference Documentation</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#working-with-existing-metal-devices">Working with existing Metal devices</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">QRhiMetalInitParams Struct</h1>
<!-- $$$QRhiMetalInitParams-brief -->
<p>Metal specific initialization parameters. <a href="#details">More...</a></p>
<!-- @@@QRhiMetalInitParams -->
<div class="table"><table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> Header:</td><td class="memItemRight bottomAlign">   <span class="preprocessor">#include &lt;QRhiMetalInitParams&gt;</span>
</td></tr></table></div><ul>
</ul>
<a name="details"></a>
<!-- $$$QRhiMetalInitParams-description -->
<div class="descr">
<h2 id="details">Detailed Description</h2>
<p>A Metal-based QRhi needs no special parameters for initialization.</p>
<pre class="cpp plain">

  QRhiMetalInitParams params;
  rhi = QRhi::create(QRhi::Metal, &amp;params);

</pre>
<p><b>Note: </b>Metal API validation cannot be enabled by the application. Instead, run the debug build of the application in XCode. Generating a <code>.xcodeproj</code> file via <code>qmake -spec macx-xcode</code> provides a convenient way to enable this.</p><p><b>Note: </b>QRhiSwapChain can only target <a href="qwindow.html">QWindow</a> instances that have their surface type set to <a href="qsurface.html#SurfaceType-enum">QSurface::MetalSurface</a>.</p><a name="working-with-existing-metal-devices"></a>
<h4 id="working-with-existing-metal-devices">Working with existing Metal devices</h4>
<p>When interoperating with another graphics engine, it may be necessary to get a QRhi instance that uses the same Metal device. This can be achieved by passing a pointer to a <a href="qrhimetalnativehandles.html">QRhiMetalNativeHandles</a> to <a href="qrhi.html#create">QRhi::create</a>(). The device must be set to a non-null value then. Optionally, a command queue object can be specified as well.</p>
<p>The QRhi does not take ownership of any of the external objects.</p>
</div>
<!-- @@@QRhiMetalInitParams -->
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2020 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br/>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br/>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
